<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
$this->title = '新增用户';
?>
<?php
$form = ActiveForm::begin([
    'action' => ['site/add'],  //提交地址
    'method' => 'post', //提交方式
    'id'     => 'registered-form',
    'options' => [
        'class' => 'form-horizontal', //设置class属性
        'enctype' => 'multipart/form-data' //文件上传时添加该编码
    ],
]);
?>

<?= $form->field($model, 'username')->textInput() ?>
<?= $form->field($model, 'password')->label('设置密码')->passwordInput() ?>
<?= $form->field($model, 'repassword')->label('重复密码')->passwordInput() ?>
<?= $form->field($model, 'email')->textInput() ?>
<?= $form->field($model, 'role')->dropDownList([
    '1' => '等级1',
    '2' => '等级2',
    '3' => '等级3',
    '4' => '等级4',
    '5' => '等级5',
    '6' => '等级6',
    '7' => '等级7',
    '8' => '等级8',
    '9' => '等级9',
    '10' => '等级10',
]) ?>

<?= Html::submitButton('注册', ['class' => 'btn btn-primary']) ?>

<?= Html::resetButton('重置', ['class' => 'btn' ]) ?>

<?php ActiveForm::end(); ?>




